package Dao

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var Db *gorm.DB

func InitMysql()(err error){
			Db,err=gorm.Open("mysql","root:qwhnszsd0952@(127.0.0.1:3306)/supershopping?charset=utf8mb4&parseTime=True&loc=Local")
			if err!=nil{
				return err
			}
			return Db.DB().Ping()
}

func Close(){
	Db.Close()
}
